<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="#op/activity_order/">高频彩订单</a>
            </li>
        </ol>
    </div>
    <div class="topbar-right">
        <span class="text text-muted" id="selectTips">已选中0个</span>
        <button class="btn btn-default btn-sm" id="refundOrder">一键退单返款</button>
        <div class="ml15 ib va-m" id="toggle_sidemenu_r">
            <a href="#" class="pl5"> <i class="fa fa-sign-in fs22 text-primary"></i>
            </a>
        </div>
    </div>
</header>

<section id="content" class="animated fadeIn">
    <div class="panel overflow" >
        <table class="table table-striped fs13" id="main-list">
            <thead>
                <tr class="bg-light">
                    <th class="text-center">
                        <input type="checkbox" id="selectAll">
                    </th>
                    <th>ID</th>
                    <th>用户ID</th>
                    <th>状态</th>
                    <th>彩种</th>
                    <th>期号</th>
                    <th>追号ID</th>
                    <th>追号状态</th>
                    <th>注单类型</th>
                    <th>注单号码</th>
                    <th>单注金额</th>
                    <th>倍数</th>
                    <th class="sortable" data-field="price">总金额</th>
                    <th class="sortable" data-field="win_price">奖金</th>
                    <th class="sortable" data-field="bonus">加奖</th>
                    <th class="sortable" data-field="created_at">创建时间</th>
                    <th class="sortable" data-field="updated_at">更新时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody class="admin-form">
                <% var moment = require('moment'); %>
                <% _.each(items, function(item){ %>
                    <tr data-id="<%= item.id %>" >
                        <td class="text-center">
                            <label class="option block mn">
                                <input type="checkbox" value="FR" class="check-row">
                                <span class="checkbox mn"></span>
                            </label>
                        </td>
                        <td><%= item.id %></td>
                        <td><a href="#stats/account/?id=<%= item.user_id %>"><%= item.user_id %></a></td>
                        <td><%= ORDER_STATUS[item.status] %></td>
                        <td><%= LOTTERY_TYPE[item.activity_type] %></td>
                        <td><%= item.term %></td>
                        <td><%= item.track_id %></td>
                        <td><%= item.track_status %></td>
                        <td><%= window.get_bet_name(item.activity_type, item.bet_type) %></td>
                        <td><%= window.replace_bet_letter(item.number)%></td>
                        <td><%= item.unit %></td>
                        <td><%= item.times %></td>
                        <td><%= item.price %></td>
                        <td><%= item.win_price %></td>
                        <td><%= item.bonus %></td>
                        <td><%= item.created_at %></td>
                        <td><%= item.updated_at %></td>
                        <td class="text-left">
                            <a href="javascript:;" data-id="<%= item.id %>" class="glyphicons glyphicons-refresh refreshStatus"></a>
                        </td>
                    </tr>
                <%
                }) %>
            </tbody>
        </table>
    </div>

    <div><div class="pull-left" id="page-tips"></div><div id="paginator"></div></div>
</section>

<!-- Start: Right Sidebar -->
<aside id="sidebar_right" class="nano">
    <div class="p20 admin-form">
        <hr class="short">
        <input type="number" title="用户ID" name="searchUid" id="searchUid" placeholder="用户ID" class="gui-input" value="<%= searched.user_id %>">
        <input type="number" title="追号ID" name="searchTrackId" id="searchTrackId" placeholder="追号ID" class="gui-input" value="<%= searched.track_id %>">
        <h6 class="fw400">状态</h6>
        <div class="section mb15">
            <label for="searchStatus" class="field select">
                <select id="searchStatus" name="searchStatus" data-field="status">
                    <option value="-1" <%= searched.status == -1 ? 'selected' : '' %>>所有</option>
                    <% _.each(ORDER_STATUS, function(v, k){%>
                        <option value="<%= k %>" <%= searched.status == k ? 'selected': 0 %>><%= v %></option>
                    <% }) %>
                </select>
                <i class="arrow double"></i>
            </label>
            <i class="arrow doube"></i>
        </div>
        <h6 class="fw400">彩种</h6>
        <div class="section mb15">
            <label for="searchActivityType" class="field select">
                <select id="searchActivityType" name="searchActivityType" data-field="activity_type">
                    <% _.each(LOTTERY_TYPE, function(v, k){%>
                        <option value="<%= k %>" <%= searched.activity_type == k ? 'selected': 0 %>><%= v %></option>
                    <% }) %>
                </select>
                <i class="arrow double"></i>
            </label>
            <i class="arrow doube"></i>
        </div>
        <h6 class="fw400">期号</h6>
        <div class="section row">
            <div class="col-md-6">
                <input type="number" title="下限" name="searchTermLower" id="searchTermLower" class="gui-input" value="<%= searched.term_lower %>">
            </div>
            <div class="col-md-6">
                <input type="number" title="上限" name="searchTermUpper" id="searchTermUpper" class="gui-input" value="<%= searched.term_upper %>">
            </div>
        </div>

        <h6 class="fw400">注单金额</h6>
        <div class="section row">
            <div class="col-md-6">
                <input type="number" title="下限" name="searchPriceLower" id="searchPriceLower" class="gui-input" value="<%= searched.price_lower %>">
            </div>
            <div class="col-md-6">
                <input type="number" title="上限" name="searchPriceUpper" id="searchPriceUpper" class="gui-input" value="<%= searched.price_upper %>">
            </div>
        </div>

        <h6 class="fw400">中奖金额</h6>
        <div class="section row">
            <div class="col-md-6">
                <input type="number" title="下限" name="searchWinPriceLower" id="searchWinPriceLower" class="gui-input" value="<%= searched.win_price_lower %>">
            </div>
            <div class="col-md-6">
                <input type="number" title="上限" name="searchWinPriceUpper" id="searchWinPriceUpper" class="gui-input" value="<%= searched.win_price_upper %>">
            </div>
        </div>

        <h6 class="fw400">开始时间</h6>
        <div class="section row">
            <div class="col-md-6">
                    <input type="text" title="下限，包含当天" name="searchCreatedAtLower" id="searchCreatedAtLower" class="gui-input" data-type="date" value="<%= searched.created_at_lower %>">
            </div>
            <div class="col-md-6">
                    <input type="text" title="上限，不包括当天" name="searchCreatedAtUpper" id="searchCreatedAtUpper" class="gui-input" data-type="date" value="<%= searched.created_at_upper %>">
            </div>
        </div>

        <button class="btn btn-default btn-block" type="button" id="search">搜索</button>
</aside>
<!-- End: Right Sidebar -->
